<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
	<th:block th:include="include :: header('新增会议')" />
	<th:block th:include="include :: datetimepicker-css" />
	<th:block th:include="include :: bootstrap-fileinput-css" />
	<meta http-equiv="Content-Type" content="text/html;charset=utf-8"/>
	<script type="text/javascript" charset="utf-8" th:src="@{/ueditor/ueditor.config.js}"></script>
	<script type="text/javascript" charset="utf-8" th:src="@{/ueditor/ueditor.all.js}"> </script>
	<script type="text/javascript" charset="utf-8" th:src="@{/ueditor/lang/zh-cn/zh-cn.js}"></script>
	<link type="text/css" rel="stylesheet" th:href="@{/ueditor/third-party/video-js/video-js.css}"/>
	<script  type="text/javascript" th:src="@{/ueditor/third-party/video-js/video.js}"></script>+
</head>
<body class="white-bg">
<div class="wrapper wrapper-content animated fadeInRight ibox-content">
	<form class="form-horizontal m" id="form-meeting-add" th:object="${union}">
		<input id="id" name="id" th:field="*{id}" type="hidden">
		<div class="form-group">
			<label class="col-sm-2 control-label is-required">领域联盟名称：</label>
			<div class="col-sm-10">
				<input id="name" name="name" class="form-control" type="text" th:field="*{name}" >
			</div>
		</div>
		<div class="form-group">
			<label class="col-sm-2 control-label">执行主任单位：</label>
			<div class="col-sm-10">
				<input id="director" name="director" class="form-control" type="text"  th:field="*{director}">
			</div>
		</div>
		<div class="form-group">
			<label class="col-sm-2 control-label">秘书长单位：</label>
			<div class="col-sm-10">
				<input id="secretary" name="secretary" class="form-control" type="text" th:field="*{secretary}">
			</div>
		</div>
		<div class="form-group">
			<label class="col-sm-2 control-label">参与会员单位：</label>
			<div class="col-sm-10">
				<input id="member" name="member" class="form-control" type="text" th:field="*{member}">
			</div>
		</div>
		<div class="form-group">
			<label class="col-sm-2 control-label">主要方向：</label>
			<div class="col-sm-10">
				<input id="direction" name="direction" class="form-control" type="text" th:field="*{direction}">
			</div>
		</div>
		<div class="form-group">
			<label class="col-sm-2 control-label">主要终端应用技术：</label>
			<div class="col-sm-10">
				<input id="technology" name="technology" class="form-control" type="text" th:field="*{technology}">
			</div>
		</div>
	</form>
</div>
<th:block th:include="include :: footer" />
<th:block th:include="include :: datetimepicker-js" />
<th:block th:include="include :: bootstrap-fileinput-js" />
<script type="text/javascript">
	var prefix = ctx + "system/union";
	var pref = ctx + "system/cloumn";

	$("#isShuffling").on("change",function  () {
		var isShuffling = $("input[id='isShuffling']").is(':checked') == true ? 1 : 0;
		if (isShuffling == 0) {
			$("#div2").attr("style", "display:none;");
		} else {
			$("#div2").attr("style", "display:block;");
		}
	})
	$("#datetimepicker-demo-3").datetimepicker({
		format: "yyyy-mm-dd hh:ii:ss",
		autoclose: true,
		todayBtn :true
	});
	$("#imgfiles").fileinput({
		language: 'zh', //设置语言
		'showUpload': true,
		'previewFileType': 'image',
		'showPreview': true,
		'showClose': false,
		allowedFileExtensions: ["png","jpg","gif","bmp","jpeg"],//接收的文件后缀
		uploadAsync: true, //默认异步上传
		uploadUrl: ctx + "common/upload", //上传的地址
		dropZoneEnabled: false,//是否显示拖拽区域
		autoReplaceBoolean : false,//选择图片时不清空原图片
		maxFileCount: 9,
		deleteUrl: ""
	});
	var img_urls =  "";
	$('#imgfiles').on('fileuploaded', function(event, data, previewId, index) {
		if(typeof(data.response.url) != 'undefined'){
			img_urls = img_urls+data.response.url;
			$("#imageurl").val(img_urls);
		}
	});


	$("#form-notice-add").validate({
		focusCleanup: true
	});

	function submitHandler() {
		if ($.validate.form()) {
			var data = $("#form-meeting-add").serializeArray();
			$.operate.save(prefix + "/edit", data);
		}
	}
	/*用户管理-新增-选择部门树*/
	function selectDeptTree() {
		var url = pref + "/selectTree"+$("#treeId").val();
		var options = {
			title: '选择栏目',
			width: "380",
			url: pref + "/selectTree/" + $("#treeId").val(),
			callBack: doSubmit
		};
		$.modal.openOptions(options);
	}
	function doSubmit(index, layero){
		var body = layer.getChildFrame('body', index);
		$("#treeId").val(body.find('#treeId').val());
		$("#treeName").val(body.find('#treeName').val());
		layer.close(index);
	}


	function changeBox(){
		var selected = $('#cloumn option:selected').val();
		if('TFA' === selected){
			$("#fa").show();
			$("#xq").hide();
			$("#wt").hide();
			$("#zj").hide();
			$("#rm").hide();
		}else if('TXQ' === selected){
			$("#fa").hide();
			$("#xq").show();
			$("#wt").hide();
			$("#zj").hide();
			$("#rm").hide();
		}else if('TWT' === selected){
			$("#fa").hide();
			$("#xq").hide();
			$("#wt").show();
			$("#zj").hide();
			$("#rm").hide();
		}else if('TZJ' === selected){
		    $("#fa").hide();
			$("#xq").hide();
			$("#wt").hide();
			$("#zj").show();
			$("#rm").hide();
		}else if('RM' === selected){
			$("#fa").hide();
			$("#xq").hide();
			$("#wt").hide();
			$("#zj").hide();
			$("#rm").show();
		}
	}


	var ue = UE.getEditor('editors',{
	});

	$(function(){
		var ue = UE.getEditor('editors')
		ue.addListener("ready", function () {
		});


		var selected = $('#cloumn option:selected').val();
		console.log(selected)
		if('TFA' === selected){
			$("#fa").show();
			$("#xq").hide();
			$("#wt").hide();
			$("#zj").hide();
			$("#rm").hide();
		}else if('TXQ' === selected){
			$("#fa").hide();
			$("#xq").show();
			$("#wt").hide();
			$("#zj").hide();
			$("#rm").hide();
		}else if('TWT' === selected){
			$("#fa").hide();
			$("#xq").hide();
			$("#wt").show();
			$("#zj").hide();
			$("#rm").hide();
		}else if('TZJ' === selected){
		    $("#fa").hide();
			$("#xq").hide();
			$("#wt").hide();
			$("#zj").show();
			$("#rm").hide();
		}else if('RM' === selected){
			$("#fa").hide();
			$("#xq").hide();
			$("#wt").hide();
			$("#zj").hide();
			$("#rm").show();
		}
	});
</script>
</body>
</html>
